<template>
  <div class="faxian">
    <h3>泊寓ING</h3>
    <span>快泊到我怀里来</span>
    <p @click="ing()">查看更多 ></p>
    <ul class="slide-box">
      <li
        class="slide-item"
        @click="ingstory(item.boyu_gid)"
        v-for="(item, index) of boyu_ing"
        :key="index"
      >
        <div class="img-items">
          <img :src="item.boyu_gimg" />
        </div>
        <p>{{ item.boyu_gtitle }}</p>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  data(){
    return {
      boyu_ing: []
    }
  },
  mounted(){
    this.axios.get("/ing").then((res) => {
      console.log(res);
      this.boyu_ing = res.data.results;
    });
  },
  methods:{
    ingstory(kw) {
      if (kw) {
        this.$router.push({
          path: "/ingstory",
          query: {
            gid: kw,
          },
        });
      }
    },
    ing(kw) {
      this.$router.push({
        path: "/ing",
      });
    }
  }
}
</script>
<style scoped>
.faxian {
  padding-left: 14px;
  padding-right: 14px;
}

.faxian > h3 {
  margin-bottom: 5px;
}

.faxian > span {
  color: #666;
}

.faxian > p {
  font-size: 14px;
  color: #888;
  float: right;
  margin-top: -22px;
}
ul,
li {
  list-style: none;
}

.slide-box {
  margin-top: 20px;
  margin-bottom: 40px;
  display: -webkit-box;
  overflow-x: auto;
  /*适应苹果*/
  -webkit-overflow-scrolling: touch;
}

.slide-item {
  width: 117px;
  /* border: 1px solid #fff; */
  margin-right: 10px;
  border-radius: 5px;
}

.slide-item > p {
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

.img-items {
  width: 100%;
  height: 155px;
  border: 1px solid #aaa;
  border-radius: 5px;
}
.slide-box::-webkit-scrollbar {
  display: none;
}
</style>
